package com.huike.web.controller.common;

import com.huike.clues.domain.vo.HomePageBaseDataVo;
import com.huike.clues.service.HomePageService;
import com.huike.common.core.controller.BaseController;
import com.huike.common.core.domain.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDate;

@RequestMapping("")
@Api(tags = "首页接口")
@RestController
public class HomePageController extends BaseController {

    @Autowired
    private HomePageService homePageService;

    @ApiOperation(value = "基础数据")
    @GetMapping()
    public AjaxResult queryBaseDate(
            @DateTimeFormat(pattern = "hh-MM-dd") LocalDate beginDate ,
            @DateTimeFormat(pattern = "hh-MM-dd") LocalDate endDate){
        HomePageBaseDataVo homePageBaseDataVo=homePageService.queryBaseDate(beginDate,endDate);
        return AjaxResult.success(homePageBaseDataVo);
    }

}
